home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / Sample Editors⁄Viewers / Panel Editor / Source / Scrollbar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-08  |  1.3 KB  |  70 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Scrollbar.h
  3.  
  4.     Contains:    Scrollbar class implementation
  5.  
  6.     Written by:    Steve Smith
  7.     
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9. */
  10.  
  11. #ifndef _SCROLLBAR_
  12. #define _SCROLLBAR_
  13.  
  14. // --- PanelEditor Includes ---
  15.  
  16. #ifndef _PANELEDITORUTILS_
  17. #include "PanelEditorUtils.h"
  18. #endif
  19.  
  20. // --- OpenDoc Includes ---
  21.  
  22. #ifndef _ODTYPES_
  23. #include <ODTypes.h>
  24. #endif
  25.  
  26. #ifndef SOM_ODFacet_xh
  27. #include <Facet.xh>
  28. #endif
  29.  
  30. // -- Macintosh Includes --
  31.  
  32. #ifndef __CONTROLS__
  33. #include <Controls.h>
  34. #endif
  35.  
  36. //==============================================================================
  37. // CScrollbar
  38. //==============================================================================
  39.  
  40. class CScrollbar {
  41.     
  42.     public:
  43.         CScrollbar();
  44.         virtual ~CScrollbar();
  45.         
  46.         void        InitScrollbar(Environment* ev, ODFacet* facet, Rect ctrlRect);
  47.         void        Size(ODUShort width, ODUShort height);
  48.         void        Dirty(ODUShort numItems);
  49.         void        Draw();
  50.         void        Adjust(ODUShort numItems);
  51.         ODBoolean    HitTest(Point where);
  52.         void        Scroll(Environment* ev, ODFrame* frame, Point where);
  53.     
  54.     protected:
  55.         void        SetLimits(ODUShort max, ODUShort min = 0);
  56.         void        Size();
  57.     
  58.     private:
  59.     
  60.     ODBoolean        fInited;
  61.     ODBoolean        fDirty;
  62.     ODUShort        fNumItems;
  63.     ControlHandle    fControl;
  64.     WindowPtr        fWindow;
  65.     ODSShort        fPartCode;
  66.     ODFacet*        fFacet;
  67. };
  68.  
  69. #endif
  70.